package com.factory.pattern.service.impl;

import com.factory.pattern.service.AbstractFactory;
import com.factory.pattern.service.Color;
import com.factory.pattern.service.Shape;

/**
 * @author chenchen
 * @description
 * @date 2023/11/17 11:37
 */
public class ColorFactory extends AbstractFactory {
    @Override
    public Color getColor(String color) {
        if(color.equalsIgnoreCase("RED")){
            return new Red();
        } else if(color.equalsIgnoreCase("GREEN")){
            return new Green();
        } else if(color.equalsIgnoreCase("BLUE")){
            return new Blue();
        }
        return null;
    }
}
